Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a v2 snapshot when running etcdutl migrate command #19168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jan 10, 2025

Refer to #17911 (comment)

This PR will make the etcdutl migrate command fully functional.

  • It creates a v2snapshot from the v3store.
    You will never see error below anymore when executing etcdutl migrate command,

    Error: cannot downgrade storage, WAL contains newer entries, as the target version (3.5.0) is lower than the version (3.6.0) detected from WAL logs
    

    After executing the migrate command for all members, you just need to directly replace the binary of each member, then all done for the offline downgrade. Of course, it's still recommended to follow/perform the online downgrade process, as it doesn't break the workload. cc @ivanvc @jmhbnz

  • It also adds a separate etcdutl v2snapshot create command
    It's just a manual last to resort solution for any potential issue. Usually we don't need it.

I need to add e2e test. I may also break down it into smaller PRs.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch 2 times, most recently from 250f708 to d8f3b56 Compare January 10, 2025 18:21
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 15.65217% with 97 lines in your changes missing coverage. Please review.

Project coverage is 68.77%. Comparing base (9db8dcb) to head (033f4cf).

Files with missing lines Patch % Lines
etcdutl/etcdutl/common.go 18.46% 50 Missing and 3 partials ⚠️
etcdutl/etcdutl/migrate_command.go 0.00% 22 Missing ⚠️
etcdutl/etcdutl/v2snapshot_command.go 0.00% 21 Missing ⚠️
etcdutl/ctl.go 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
server/etcdserver/api/membership/cluster.go 88.57% <100.00%> (+0.04%) ⬆️
etcdutl/ctl.go 0.00% <0.00%> (ø)
etcdutl/etcdutl/v2snapshot_command.go 0.00% <0.00%> (ø)
etcdutl/etcdutl/migrate_command.go 0.00% <0.00%> (-9.79%) ⬇️
etcdutl/etcdutl/common.go 16.43% <18.46%> (+16.43%) ⬆️

... and 20 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19168      +/-   ##
==========================================
- Coverage   68.87%   68.77%   -0.11%     
==========================================
  Files         420      421       +1     
  Lines       35649    35736      +87     
==========================================
+ Hits        24554    24576      +22     
- Misses       9674     9741      +67     
+ Partials     1421     1419       -2     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9db8dcb...033f4cf. Read the comment docs.

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from d8f3b56 to 033f4cf Compare January 10, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants